/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.mldn.demo;

/**
 *
 * @author Administrator
 */
public class MultStateDemo {

    public static void main(String[] args) {
        B03 b03 = new B03();
        A03 a03 = b03;
        a03.fun1();
        a03.fun2();

        A04 b04 = new B04();
        b04.fun1();
        b04.fun2();
    }
}

class A03 {

    public void fun1() {
        System.out.println("A-> public void fun1(){}");
    }

    public void fun2() {
        this.fun1();
    }
}

class B03 extends A03 {

    public void fun1() {
        System.out.println("B->void fun1(){}");
    }

    public void fun3() {
        System.out.println("B->void fun3(){}");
    }
}

class A04 {

    public void fun1() {
        System.out.println("A04-> public void fun1(){}");
    }

    public void fun2() {
        this.fun1();
    }
}

class B04 extends A04 {

    public void fun1() {
        System.out.println("B04->void fun1(){]");
    }

    public void fun3() {
        System.out.println("B04->void fun3(){}");
    }
}
